package com.xuecheng.api.cms;

import com.xuecheng.framework.domain.cms.CmsPage;
import com.xuecheng.framework.domain.cms.request.QueryPageRequest;
import com.xuecheng.framework.domain.cms.response.CmsPageResult;
import com.xuecheng.framework.domain.course.response.PreviewResult;
import com.xuecheng.framework.domain.course.response.PublishResult;
import com.xuecheng.framework.model.response.QueryResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "cms后台管理接口", description = "管理后面页面数据，提供页面的增删改查")
public interface CmsPageControllerApi {
    @ApiOperation("分页查询列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页码", required = true, paramType = "path", dataType = "int"),
            @ApiImplicitParam(name = "size", value = "每页显示条数", required = true, paramType = "path", dataType = "int")
    })
    public QueryResponseResult findList(int page, int size, QueryPageRequest q);

    @ApiOperation("添加操作")
    public CmsPageResult add(CmsPage cmsPage);

    @ApiOperation("根据id查询页面信息")
    public CmsPageResult findById(String pageId);

    @ApiOperation("修改页面信息")
    public CmsPageResult update(CmsPage cmsPage, String id);

    @ApiOperation("根据id删除")
    public CmsPageResult delete(String pageId);

    @ApiOperation("保存页面信息")
    public CmsPageResult savePageByCourse(CmsPage cmsPage);

    @ApiOperation("一键发布")
    public PublishResult oneKeyPublish(CmsPage cmsPage);
}
